Skip to content

fix(launcher/citicore): fall back to Win32 UI and downlevel SEH handling under Wine - #4095

Open
RatPrez wants to merge 2 commits into
citizenfx:masterfrom
RatPrez:master
Open

fix(launcher/citicore): fall back to Win32 UI and downlevel SEH handling under Wine#4095
RatPrez wants to merge 2 commits into
citizenfx:masterfrom
RatPrez:master

Conversation

@RatPrez

@RatPrez RatPrez commented Jul 29, 2026

Copy link
Copy Markdown

Goal of this PR

Get the legacy FiveM client to a point where it can actually start under Wine/Proton on Linux. Right now it doesn't get past the launcher, two separate things kill it before you even see a window.

Let me know if there is any genuine issues with this code being merged.

...

How is this PR achieving the goal

Two unrelated Wine-compat fixes, both gated behind the existing CfxIsWine() check in LaunchMode.h so native Windows behavior is untouched:

  1. client/launcher/UpdaterUI.cpp

The update/patch splash screen is built with WinRT XAML Islands DesktopWindowXamlSource, which Wine doesn't implement.

The code already has a working plain-Win32-controls fallback g_uui.tenMode = false, used for older Windows and safe mode.

Added Wine to the existing forceOff checks in UI_InitTen() so it takes that path instead of trying to init XAML and dying.

  1. client/citicore/SEHTableHandler.Win32.cpp

CoreRT_SetupSEHHandler disassembles RtlLookupFunctionTable in ntdll.dll to locate the internal RtlpxLookupFunctionTable.

Wine's ntdll doesn't match real ntdll's binary layout, so the lookup never finds it, and since IsWindows8OrGreater() reports true under Wine, it was hitting a FatalError().

The code already has a fallback path for genuinely older/downlevel OS's that hooks RtlLookupFunctionTable directly instead, routed Wine into that same path instead of the fatal error.

...

This PR applies to the following area(s)

FiveM, RedM

...

Successfully tested on

Platforms: Windows, Linux

...

Checklist

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes.

@github-actions github-actions Bot added the invalid Requires changes before it's considered valid and can be (re)triaged label Jul 29, 2026
@RatPrez RatPrez changed the title fix: fall back to Win32 UI and downlevel SEH handling under Wine fix(launcher/citicore): fall back to Win32 UI and downlevel SEH handling under Wine Aug 12, 2026
@github-actions github-actions Bot added triage Needs a preliminary assessment to determine the urgency and required action RedM Issues/PRs related to RedM invalid Requires changes before it's considered valid and can be (re)triaged and removed invalid Requires changes before it's considered valid and can be (re)triaged triage Needs a preliminary assessment to determine the urgency and required action labels Aug 12, 2026
Signed-off-by: Richard Saville <41370482+RatPrez@users.noreply.github.com>
Wine's ntdll doesn't match real ntdll's binary layout, so
RtlpxLookupFunctionTable is never found there either, even on
builds that report as Windows 8+. Skip straight to hooking
RtlLookupFunctionTable directly when running under Wine, same
as we already do for pre-Win8 systems.

Signed-off-by: Richard Saville <41370482+RatPrez@users.noreply.github.com>
@RatPrez

RatPrez commented Aug 13, 2026

Copy link
Copy Markdown
Author

I did have a question for any maintainers on the sticky and adhesive differences.

I compared sticky and adhesive includes using objdump and noticed that sticky doesn't import ws2_32 or any of the FiveM internal network dlls, which would explain why it never sends cfxTicket2 on connection.

When you launch FiveM under sticky it does validate and assign you a R* license (visible in the main menu) and puts you into insecure mode because I am running linux, but it never sends the cfxTicket2 ticket.

Is there any way to enable this on linux? Maybe even a local build workaround? Without it, it becomes difficult to develop using frameworks locally.

Obviously I understand the issues with validating a license when something is "insecure", but I thought it was still worth an ask.

Thanks in advance :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

invalid Requires changes before it's considered valid and can be (re)triaged RedM Issues/PRs related to RedM

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant